home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / progtool / c / dev_lib1 / dev_test / dev_test.c next >
C/C++ Source or Header  |  1995-11-25  |  860b  |  45 lines

  1. #include <import.h>
  2. #include <device.h>
  3.  
  4. #include <export.h>
  5.  
  6. /*
  7.  * Kurzes Programm zum Ausgeben der zur Verfügung stehenden
  8.  * Schnittstellen und der möglichen Geschwindigkeiten:
  9.  */
  10. GLOBAL WORD main( VOID )
  11. {
  12.     DEV_LIST    *ports, *walk;
  13.     LONG        *speeds;
  14.     
  15.     if( (ports=InitDevices( NULL, NULL ))==NULL )
  16.         return( FAILURE );
  17.     
  18.     walk = ports;
  19.     while( walk )
  20.     {
  21.         if( OpenDevice( walk ) )
  22.         {
  23.             speeds = GetSpeedList( walk );
  24.             
  25.             printf( "\nPort: %s (curr. DTE: %ld)", walk->name, walk->curr_dte );
  26.             printf( "\nAvailable DTE speeds:" );
  27.             while( *speeds>=0 )
  28.                 printf( "\n                      %ld", *speeds++ );
  29.             
  30.             CloseDevice( walk );
  31.             
  32.             printf( "\n\n                             ... [RETURN] to continue" );
  33.             getchar( );
  34.         }
  35.         
  36.         
  37.         walk = walk->next;
  38.     }
  39.     
  40.     TermDevices( );
  41.     
  42.     return( SUCCESS );
  43. }
  44.  
  45.